function postBoard(){
	var title = getObj('board').value;
	var uid = getObj('board_uid').value;
	if (typeof(uid) == "undefined") {
		showDialog('error','没有要留言的对象');
		return false;
	}
	if (title.length < 3 || title.length > 200) {
		showDialog('error','留言的字数请保证在3～200之内');
		return false;
	}
	if (uid == winduid) {
		showDialog('error','不能自己给自己留言');
		return false;
	}
	
	ajax.send('mode.php?m=o&q=ajax&action=postboard','&uid='+uid+'&title='+ajax.convert(title),function(){
		var rText = ajax.request.responseText.split('\t');
		if (rText[0]=='success') {
			creatBoard('board_container',rText[1],rText[2],title);
			getObj('board').value = '';
		} else {
			ajax.guide();
		}
	});
}
function delBoard(bid){
	if (isNaN(bid)) {
		showDialog('error','错误');
	}
	ajax.send('mode.php?m=o&q=ajax&action=delboard','id='+bid,function(){
		var rText = ajax.request.responseText;
		if (rText=='success') {
			delElement('board_'+bid);
		} else {
			ajax.send();
		}
	});
}
function creatBoard(container,bid,face,title){
	if (isNaN(bid)) {
		showDialog('error','错误');
	}
	container = objCheck(container);
	var dd	= elementBind('dd','board_'+bid,'cc pdD');
	var div	= elementBind('div');
	var inner_dl= elementBind('dl','','cc mt8');
	var inner_dd1	= elementBind('dd','','fl pdr');
	var img	= elementBind('img','','fl pdr portrait-s');
	img.src	= face;
	inner_dd1.appendChild(img);
	var inner_del	= elementBind('dd','','fr gray');
	var del	= elementBind('a','','','cursor: pointer;');
	del.setAttribute('onclick',"pwConfirm('是否确定删除本条留言',this,function(){delBoard('"+bid+"')})");
	del.innerHTML	= '删除';
	inner_del.appendChild(del);
	
	var inner_dd2	= elementBind('dd','','fl cc');

	var a	= elementBind('a');
	a.href	= 'mode.php?m=o&q=user';
	a.innerHTML	= windid;
	inner_dd2.appendChild(a);
	var span	= elementBind('span','','gray','margin-left:2px');
	var date = new Date();
	var thispost = dateFormat(date,'yyyy-mm-dd hh:ii:ss');
	span.innerHTML = thispost + '留言道:';
	inner_dd2.appendChild(span);
	var inner_div = elementBind('div','','pdD');
	inner_div.innerHTML = char_cv(title);
	inner_dd2.appendChild(inner_div);
	
	inner_dl.appendChild(inner_dd1);
	inner_dl.appendChild(inner_del);
	inner_dl.appendChild(inner_dd2);
	
	div.appendChild(inner_dl);
	dd.appendChild(div);
	
	var dds = container.getElementsByTagName('dd');
	if (typeof(dds)=='object' && dds.length>0) {
		var firstdd = dds[0];
		container.insertBefore(dd,firstdd);
	} else {
		container.appendChild(dd);
	}
}